package com.jishuo.nontax.util;

/**
 * 票据状态定义
 */
public class BillStateUtil {
    /** 一般缴款书 */
    public static final int BillType_ChargeBill = 1;
    /** 手工票 */
    public static final int BillType_ChargeBillManual = 101;
    /** 学生缴费 */
    public static final int BillType_Student = 9;
    /** 交通罚款 */
    public static final int BillType_Illegal = 10;
    /** 划解专户 */
    public static final int BillType_SpecialPay = 6;
    /** 划解国库 */
    public static final int BillType_FiscPay = 5;
    /** 退付书 */
    public static final int BillType_BackBill = 2;
    /** 划解分成 */
    public static final int BillType_DividePay = 7;
    /** 电子缴款 */
    public static final int BillType_EticketNum = 17;

    private static final String[] StateMsg = {"查询失败", "正常", "账户类型不符", "已收款", "票据不存在", "对账不成功，账户停用", "已被他行获取",
            "验签未通过", "报文数据不正确", "缴款书超期", "票据已用", "票据已核销"};

    public static String getBillState(int billType, int billState) {
        int msgNo = billState;
        switch (billType) {
            case BillType_ChargeBill:
                if (billState == 6) msgNo = 7;
                if (billState == 7) msgNo = 9;
                break;
            case BillType_ChargeBillManual:
                if (billState == 2) msgNo = 10;
                if (billState == 3) msgNo = 11;
                if (billState == 6) msgNo = 7;
                if (billState == 7) msgNo = 8;
                break;
            case BillType_Student:
                if (billState == 4) msgNo = 5;
                if (billState == 5) msgNo = 7;
                if (billState == 6) msgNo = 4;
                break;
            case BillType_Illegal:
                break;
            case BillType_SpecialPay:
            case BillType_FiscPay:
            case BillType_BackBill:
            case BillType_DividePay:
                if (billState == 5) msgNo = 7;
                if (billState == 6) msgNo = 8;
                break;
            case BillType_EticketNum:
                break;
            default:
                msgNo = 0;
        }
        return StateMsg[msgNo];
    }
}
